package com.zhr.handler;

import com.zhr.server.WeixinRequest;
import com.zhr.server.WeixinResponse;

public abstract class MessageAbstractHandler implements MessageHandler {

	@Override
	public WeixinResponse handle(WeixinRequest request) {
		WeixinResponse response = new WeixinResponse();
		response.setFromUserName(request.getToUserName());
		response.setToUserName(request.getFromUserName());
		response.setCreateTime(String.valueOf(System.currentTimeMillis() / 1000));
		return response;
	}
	
	@Override
	public int compareTo(MessageHandler o) {
		return o.getPriority() - getPriority();
	}

}
